package org.achartengine.internal.chart;

import android.graphics.Canvas;
import android.graphics.Paint;
import java.util.List;
import org.achartengine.internal.renderer.XYMultipleSeriesRenderer;

/* loaded from: classes2.dex */
public class c extends k {
    private k[] a;
    private Class[] b;

    @Override // org.achartengine.internal.chart.k
    public String c() {
        return "Combined";
    }

    public c(org.achartengine.internal.model.g gVar, XYMultipleSeriesRenderer xYMultipleSeriesRenderer, String[] strArr) {
        super(gVar, xYMultipleSeriesRenderer);
        this.b = new Class[]{j.class, f.class, BarChart.class, b.class, f.class, i.class, h.class};
        int length = strArr.length;
        this.a = new k[length];
        for (int i = 0; i < length; i++) {
            try {
                this.a[i] = a(strArr[i]);
            } catch (Exception unused) {
            }
            if (this.a[i] == null) {
                throw new IllegalArgumentException("Unknown chart type " + strArr[i]);
            }
            org.achartengine.internal.model.g gVar2 = new org.achartengine.internal.model.g();
            gVar2.a(gVar.b(i));
            XYMultipleSeriesRenderer xYMultipleSeriesRenderer2 = new XYMultipleSeriesRenderer();
            xYMultipleSeriesRenderer2.e(xYMultipleSeriesRenderer.Y());
            xYMultipleSeriesRenderer2.j(xYMultipleSeriesRenderer.af());
            xYMultipleSeriesRenderer2.a(xYMultipleSeriesRenderer.a(i));
            this.a[i].a(gVar2, xYMultipleSeriesRenderer2);
        }
    }

    private k a(String str) throws IllegalAccessException, InstantiationException {
        int length = this.b.length;
        k kVar = null;
        for (int i = 0; i < length && kVar == null; i++) {
            k kVar2 = (k) this.b[i].newInstance();
            if (str.equals(kVar2.c())) {
                kVar = kVar2;
            }
        }
        return kVar;
    }

    @Override // org.achartengine.internal.chart.k
    public void a(Canvas canvas, Paint paint, float[] fArr, org.achartengine.internal.renderer.b bVar, float f, int i) {
        this.a[i].a(canvas, paint, fArr, bVar, f, 0);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // org.achartengine.internal.chart.k
    public void a(org.achartengine.internal.model.h hVar, Canvas canvas, Paint paint, List<Float> list, org.achartengine.internal.renderer.b bVar, float f, int i, XYMultipleSeriesRenderer.Orientation orientation) {
        this.a[i].a(hVar, canvas, paint, list, bVar, f, 0, orientation);
    }

    @Override // org.achartengine.internal.chart.a
    public int a(int i) {
        return this.a[i].a(0);
    }

    @Override // org.achartengine.internal.chart.a
    public void a(Canvas canvas, org.achartengine.internal.renderer.b bVar, float f, float f2, int i, Paint paint) {
        this.a[i].a(canvas, bVar, f, f2, 0, paint);
    }
}
